let app = getApp();
Page({
  data: {
    "amount": 0,
    "accountCashAmount": 0,
    "balance": 0,
    "dealAmount": 0,
    "investmentBalance":0,
  },
  jumpMineWine: function(event) {
    var thisId = event.currentTarget.id,
      url = '';
    if (thisId === "bargain") {
      app.toast("正在开发中...");
      // url = "/pages/mine/mine_Physical_money/Phy_deal_detail/Phy_deal_detail";     
    } else {
      url = "/pages/mine/mine_Physical_money/Phy_wdeposit_detail/Phy_wdeposit_detail";
    }
    wx.navigateTo({
      url: url
    });
  },
  onLoad: function(options) {
    wx.showLoading({
      title: '请稍等...',
    });
    let that = this;
    app.post('findCapitalAccountDetails').then((res) => {
      let dealAmount = res.data.dealAmount ? dealAmount = res.data.dealAmount : dealAmount = 0;
      let amount = res.data.amount ? amount = res.data.amount : amount = 0;
      let balance = res.data.balance ? balance = res.data.balance : balance = 0;
      let accountCashAmount = res.data.accountCashAmount ? accountCashAmount = res.data.accountCashAmount : accountCashAmount = 0;
      let investmentBalance = res.data.investmentBalance ? investmentBalance = res.data.investmentBalance : investmentBalance = 0;
      wx.hideLoading();
      that.setData({
        amount: amount/100,
        accountCashAmount: accountCashAmount / 100,
        balance: balance / 100,
        dealAmount: dealAmount / 100,
        investmentBalance: investmentBalance/100
      })
    }).catch((e) => {
      wx.hideLoading();
      wx.hideNavigationBarLoading();
      app.toast("网络或服务器错误～");
    })
  },
})